home *** CD-ROM | disk | FTP | other *** search
- on openPrinter
- global gPrinterObj
- closePrinter()
- openXLib("print_x")
- set gPrinterObj to PRINT_X(mnew)
- end
-
- on closePrinter
- global gPrinterObj
- if objectp(gPrinterObj) then
- gPrinterObj(mdispose)
- end if
- end
-
- on printRecipe
- global gPrinterObj, gCurrentNote
- put field "ingredients" into field "ingredients print"
- put field "instructions" into field "instructions print"
- set body to field "title" & RETURN & RETURN & "Ingredients:" & RETURN & RETURN & removeReturns("ingredients print") & RETURN & RETURN & "Instructions:" & RETURN & RETURN & field "instructions print"
- getnotes()
- put RETURN after body
- put "Note:" after body
- put RETURN after body
- put gCurrentNote after body
- put RETURN after body
- put RETURN after body
- put "Copyright 1995, Multicom Publishing, Inc." & RETURN after body
- set bodies to []
- repeat while 1
- if the number of lines in body > 56 then
- add(bodies, line 1 to 56 of body)
- delete line 1 to 56 of body
- next repeat
- end if
- add(bodies, body)
- exit repeat
- end repeat
- repeat with body in bodies
- openPrinter()
- gPrinterObj(mSetBodyStyle, "times", 10, 0)
- gPrinterObj(mSetBodyTop, 0)
- gPrinterObj(mPrintPage, EMPTY, EMPTY, body, EMPTY, 0)
- closePrinter()
- waste()
- end repeat
- end
-
- on printShopping
- global gPrinterObj, gShoppingTitles
- set body to EMPTY
- set body to "Shopping list for the following recipe(s):"
- put RETURN after body
- put RETURN after body
- repeat with i in gShoppingTitles
- put i & RETURN after body
- end repeat
- put RETURN after body
- put RETURN & field "list" after body
- set numberOfLines to the number of lines in body
- set linesOnLastPage to numberOfLines mod 56
- if linesOnLastPage < 55 then
- repeat with i = linesOnLastPage to 55
- put RETURN after body
- end repeat
- put "Copyright 1995, Multicom Publishing, Inc." after body
- else
- put RETURN & "Copyright 1995, Multicom Publishing, Inc." after body
- end if
- set bodies to []
- repeat while 1
- if the number of lines in body > 56 then
- add(bodies, line 1 to 56 of body)
- delete line 1 to 56 of body
- next repeat
- end if
- add(bodies, body)
- exit repeat
- end repeat
- repeat with body in bodies
- openPrinter()
- gPrinterObj(mSetBodyStyle, "times", 10, 0)
- gPrinterObj(mSetBodyTop, 20)
- gPrinterObj(mPrintPage, EMPTY, EMPTY, body, EMPTY, 0)
- closePrinter()
- waste()
- end repeat
- end
-
- on printPlanner
- global gPrinterObj
- set title to "Meal Plan for " & field "name" & " " & field "month" & " " & field "day" & ", " & field "year"
- if the frame = label("weekly") then
- set body to title & RETURN & RETURN & field "days" & RETURN & RETURN & field "weekNotes"
- else
- set body to title & RETURN & RETURN & field "meals" & RETURN & RETURN & field "dayNotes"
- end if
- set numberOfLines to the number of lines in body
- set linesOnLastPage to numberOfLines mod 56
- if linesOnLastPage < 54 then
- repeat with i = linesOnLastPage to 54
- put RETURN after body
- end repeat
- put "Copyright 1995, Multicom Publishing, Inc." after body
- else
- put RETURN & "Copyright 1995, Multicom Publishing, Inc." after body
- end if
- set bodies to []
- repeat while 1
- if the number of lines in body > 56 then
- add(bodies, line 1 to 56 of body)
- delete line 1 to 56 of body
- next repeat
- end if
- add(bodies, body)
- exit repeat
- end repeat
- repeat with body in bodies
- openPrinter()
- gPrinterObj(mSetBodyStyle, "times", 10, 0)
- gPrinterObj(mSetBodyTop, 20)
- gPrinterObj(mPrintPage, EMPTY, EMPTY, body, EMPTY, 0)
- closePrinter()
- waste()
- end repeat
- end
-
- on waste
- startTimer()
- repeat while the timer < 120
- updateStage()
- end repeat
- end
-